<template>
  <img :src="result && result.message">
</template>

<script lang="ts">
import axios from "axios";
import {defineComponent} from "vue";

export default defineComponent({
  async setup(){
    // 改为错误地址后，触发onErrorCaptured
    const rawData = await axios.get('https://dog.ceo/api/breeds/image/random');
    console.error(rawData)
    return {
      result: rawData.data
    }
  }
})
</script>

<style scoped>

</style>
